/**
 * 
 */

var last_num = 0;

function rediract_this(value) {

	var frm_re = document.frm;
	if (last_num == 1) {
		frm_re.c_draft_approbator_1.value = value;
	} else if (last_num == 2) {
		frm_re.c_draft_approbator_2.value =  value;
	} else if (last_num == 3) {
		frm_re.c_draft_approbator_3.value =  value;
	} else if (last_num == 4) {
		frm_re.c_draft_approbator_4.value =  value;
	} else if (last_num == 5) {
		frm_re.c_draft_approbator_5.value =  value;
	} else{
		
	}
	frm_re.action = "form_payment1.jsp";
	frm_re.submit();

}

var PopLayer = {
	el : "",
	Xpos : "",
	Ypos : "",

	action : function(el, lastnum) {
		if (this.el != "") {
			var opened = document.getElementById(this.el);
			opened.style.display = "none";
			this.el = "";
		}
		
		last_num = lastnum;
		PopLayer.open(el);
	},
	open : function(el) {
		if (document.all) {
			this.Xpos = event.clientX - 200;
			this.Ypos = event.clientY - 200;
			if (this.Xpos > 680) {
				this.Xpos = 640;
			}
			if (this.Ypos > 400) {
				this.Ypos = 350;
			}
		} else {
			this.Xpos = event.clientX - 200;
			this.Ypos = event.clientY - 200;
			if (this.Xpos > 680) {
				this.Xpos = 640;
			}
			if (this.Ypos > 400) {
				this.Ypos = 350;
			}
		}
		this.el = el;
		el = document.getElementById(el);

		el.style.left = document.body.scrollLeft + this.Xpos + "px";
		el.style.top = document.body.scrollTop + this.Ypos + "px";
		el.style.display = "block";
	},
	close : function(el) {
		// this.el = "";
		el = document.getElementById(PopLayer.el);
		el.style.display = "none";
	}
}

function finish(save_type) {
	
	var frm_re = document.frm;
	frm_re.action = "save_form.jsp?save_type="+save_type;
	frm_re.submit();
}

function done() {
	window.opener=self;
	window.close();
}

function rollback() {
	var frm_re = document.frm;
	frm_re.action = "form_payment1.jsp";
	frm_re.submit();
}